package com.qiye.pointsserver.service;

import com.qiye.pointsserver.model.entity.Pointslog;
import com.qiye.pointsserver.model.entity.Userinfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserInfoRepository extends JpaRepository<Userinfo, Long> {


    @Query(value = "SELECT * FROM sys_userinfo WHERE DATE_FORMAT(birthdate, '%m-%d') = DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 7 DAY), '%m-%d')", nativeQuery = true)
    List<Userinfo> findUsersWithBirthdayIn7Days();

}
